<head>
  <style>
      table, th, td {
          border: 1px solid black;
          border-collapse: collapse;
      }
      th,td {
          padding: 15px;
          text-align: center;
      }
  </style>
</head>
<h1 align="center">Hiring Specialist Home</h1>

<% if( @applications.length > 0) %>
    <table style="width:100%"; bgcolor="#F6F6FF">
      <tr>
        <th> Applicant Name</th>
        <th> Phone Number</th>
        <th> Store Location - Position</th>
        <th> Phone Interview</th>
      </tr>


          <% $numApplication = 0 %>
          <% @applications.each do |application| %>
            <tr>
                <%= form_tag(controller: 'hiring_specialist', action: 'interview', method: 'get') do %>
                    <%= hidden_field_tag('appPersonalInfo', application['application_data']) %>
                    <%= hidden_field_tag('app_id', application['application_id']) %>

                  <td> <%= @pInfo[$numApplication]['first'] %> <%= @pInfo[$numApplication]['middle'] %> <%= @pInfo[$numApplication]['last'] %> </td>
                  <td> <%= @pInfo[$numApplication]['phone'] %> </td>
                  <td>
                    <% @open.each do |pos| %>
                        <% if( pos['posting_id'] == @pInfo[$numApplication]['post_id'] ) then %>
                            <%= pos['city'] %>, <%= pos['state'] %> - <%= pos['title'] %>
                            <% break %>
                        <% end %>
                    <% end %>
                  </td>
                  <td><%= submit_tag('Select') %></td>

                  <% $numApplication += 1 %>
                <% end %>
          </tr>
      <% end %>
    </table>
<% else %>
    <br /><br /><h2>No Applications to display</h2>
<% end %>
